// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router'
import Experiment from '../views/Student/Experiment.vue'
import ScoreHistory from '../views/Student/ScoreHistory.vue'
import TeacherCommandManagement from  '../views/Teacher/CommandManagement.vue'
import TeacherExperimentManagement from '../views/Teacher/ExperimentManagement.vue'
import TeacherGradeView from '../views/Teacher/GradeView.vue'
import AdminSystemConfig from '../views/Admin/SystemConfig.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import ImageManagement from "@/views/Teacher/ImageManagement.vue";

const routes = [
    {
        path: '/',
        name: 'Experiment',
        component: Experiment,
        meta: { navLabel: '实验页面', roles: ['student','teacher'] }
    },
    {
        path: '/score-history',
        name: 'ScoreHistory',
        component: ScoreHistory,
        meta: { navLabel: '历史成绩', roles: ['student'] }
    },
    {
        path: '/teacher/command-management',
        name: 'TeacherCommandManagement',
        component: TeacherCommandManagement,
        meta: { navLabel: '命令管理', roles: ['teacher'] }
    },
    {
        path: '/teacher/experiment-management',
        name: 'TeacherExperimentManagement',
        component: TeacherExperimentManagement,
        meta: { navLabel: '实验步骤管理', roles: ['teacher'] }
    },
    {
        path: '/teacher/grade-view',
        name: 'TeacherGradeView',
        component: TeacherGradeView,
        meta: { navLabel: '班级成绩', roles: ['teacher'] }
    },
    {
        path: '/teacher/image-management',
        name: 'ImageManagement',
        component: ImageManagement,
        meta: { navLabel: '图片资源管理', roles: ['teacher'] }
    },
    {
        path: '/admin/system-config',
        name: 'AdminSystemConfig',
        component: AdminSystemConfig,
        meta: { navLabel: '系统配置', roles: ['admin'] }
    },
    {
        path: '/login',
        name: 'Login',
        component: Login,
        meta: { navLabel: '登录', roles: ['anonymous'] }
    },
    {
        path: '/register',
        name: 'Register',
        component: Register,
        meta: { navLabel: '注册', roles: ['anonymous'] }
    },
    {
        path: '/report',
        name: 'ReportSubmission',
        component: () => import('@/views/Student/ReportSubmission.vue'),
        meta: {
            navLabel: '报告提交',
            roles: ['']
        }
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes,
})

export default router
